<template>
    <el-card class="search-panel">
        <schema-search-bar :schema="searchSchema" ref="schemaSearchBar" @search="onSearch"></schema-search-bar>
    </el-card>
</template>

<script setup>
// eslint-disable-next-line no-unused-vars
import SchemaSearchBar from '$widget/schema-search-bar/schema-search-bar.vue'
import { inject, defineEmits, ref } from 'vue'

const { searchSchema } = inject('schemaViewData')
const emit = defineEmits(['search'])
const schemaSearchBar = ref(null)
const onSearch = (searchObj) => {
    searchObj = schemaSearchBar.value?.getValue() || {}
    emit('search', searchObj)
}
</script>

<style scoped lang="less">
.search-panel {
    margin: 10px 0;
}

:deep(.el-card__body) {
    padding-bottom: 2px;
}
</style>
